import {
	defineStore
} from 'pinia';
import {
	ref
} from 'vue';

export const useCounterStore = defineStore('counter', () => {
	const count = ref(0);
	const userid = ref('')

	function increment() {
		count.value++;
	}

	function useridFn(id){
		count.userid = id
	}
	
	return {
		count,
		increment,
		userid,
		useridFn
	}

}, {
	persist: {
		storage: {
			// 修改存储方式
			getItem: uni.getStorageSync,
			setItem: uni.setStorageSync
		}
	}
});